package com.example.boot3new;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Springboot3的核心原理
 *      1.生命周期监听:监听器-SpringApplicationRunListener
 *          1.1.自定义监听器，编写SpringApplicationRunListener实现类
 *          1.2.在META-INF/spring.factories文件配置自定义的Listener
 *             例如：org.springframework.boot.SpringApplicationRunListener=\
 * org.springframework.boot.context.event.EventPublishingRunListener
 *          1.3.spring-boot项目默认配置的监听器
 *          org.springframework.boot.SpringApplicationRunListener=\
 * org.springframework.boot.context.event.EventPublishingRunListener
 *
 *
 *
 *
 * springboot启动流程
 *      引导
 *          启动
 *          准备环境
 *      启动
 *          contextPrepared
 *          contextLoade
 *          started
 *              容器刷新过程
 *                  工厂
 *                  自动配置生效
 *
 *              组件
 *                  所有的组件被创建，
 *
 *          ready
 *      运行
 *          running
 *
 */
@SpringBootApplication
public class Boot3NewApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(Boot3NewApplication.class, args);


        String[] nam = run.getBeanDefinitionNames();

        for (String name: nam
             ) {
            System.out.println("name = " + name);
        }

    }

}
